package com.hmdp.utils;

/**
 * <p>Project: hm-dianping-com.hmdp.utils-ILock
 * <p>Powered by yishun On 2023-03-20 22:23:45
 *
 * @author yishun [2465734101@qq.com]
 * @version 1.0
 * @since 17
 */
public interface ILock {
    /**
     * 尝试获取锁
     * @param timeoutSec 锁持有的超时时间，过期后自动释放
     * @return true代表获取锁成功，false代表获取锁失败
     */
    boolean tryLock(long timeoutSec);


    /**
     * 释放锁
     */
    void unlock();
}
